<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePublisherInviteCodesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('publisher_invite_codes', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('publisher_uid')->default(0)->commet('发布者uid');
            $table->string('code')->default('')->comment('发布者邀请码');
            $table->integer('invitee_uid');
            $table->timestamps();
        });

        \DB::statement('alter table publisher_invite_codes comment "信息发布者的邀请码"');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('publisher_invite_codes');
    }
}
